<!-- 子菜单 -->
<template>
  <a-sub-menu :key="menuInfo.path">

    <template #title>
      <span>
        <!-- <i v-if="menuInfo.meta.resIconKind" :class="['iconfont', menuInfo.meta.resIconKind]"></i> -->
        <span>{{ menuInfo.meta }}</span>
      </span>
    </template>
   <div v-if="menuInfo.children" >
    <div v-for="(item,num) in menuInfo.children" :key="num">
      <!-- <template> -->
        <a-menu-item v-if="!item.children" :key="item.path">
          <span>{{ item.meta }}</span>
        </a-menu-item>
        <menuItem :key="item.path" v-else :menuData="item" />
      <!-- </template> -->

    </div>
   </div>
  </a-sub-menu>
</template>

<script setup lang="ts">
import { defineProps, toRefs,ref,watch } from 'vue';
// import { useRoute, useRouter } from 'vue-router'
import type { RouteData } from 'stores/user/type/type'
import menuItem from "@/components/NavMenu/menuItem.vue";
type menuType = {
  path: string,
  paths: string,
  // icon: string,
  name: string,
  meta: {
    resIconKind: ''
  },
  // key: string,
  children: menuType[],
  // resourceFrom: string
}

const props = defineProps<{
  menuData: any
}>()
const menuInfo:any =ref(props.menuData)
// console.log(menuInfo);
watch(()=>props.menuData,(newval:any)=>{
  menuInfo.value= newval
})

// function clickMenuTitle(item: RouteData) {
//   console.log("1231231",item);
//   if (route.path == item.path) {

//     return;
//   }

//   // 路由跳转，面包屑设置
//   // router.push(item.path);
// }

</script>
<style lang="scss" scoped></style>
